const { http } = uni.$u

export const appInit = (params, config = {}) => http.post('admin/index/index', params, config);
export const login = (params, config = {}) => http.post('admin/Index/login', params, config);

export const get_config = (params, config = {}) => http.post('index/get_config', params, config);


export const getUserInfo = (params, config = {}) => http.post('admin/index/account', params, config);
export const updateProfile = (params, config = {}) => http.post('admin/auth.Admin/edit', params, config);
export const getOrderLists = (params, config = {}) => http.post('admin/account/orders', params, config);
export const getOrderDetail = (params, config = {}) => http.post('admin/account/orderDetail', params, config);
export const userOverview = (params, config = {}) => http.post('api/index/overview', params, config);

export const carLists = (params, config = {}) => http.post('api/car/lists', params, config);
// export const carDetail = (params, config = {}) => http.post('api/car/index', params, config);
export const carAdd = (params, config = {}) => http.post('api/car/add', params, config);
export const carEdit = (params, config = {}) => http.post('api/car/edit', params, config);
export const carDel = (params, config = {}) => http.post('api/car/del', params, config);
export const carOrders = (params, config = {}) => http.post('api/car/orders', params, config);
export const carOrderDetail = (params, config = {}) => http.post('api/car/orderDetail', params, config);
export const carOrderDone = (params, config = {}) => http.post('api/car/orderDone', params, config);
export const subOrder = (params, config = {}) => http.post('api/car/subOrder', params, config);

export const storeList = (params, config = {}) => {
	const limit = params.limit ? params.limit : 10;
	const page = params.page ? params.page : 1;
	const url = `admin/Store/index?limit=${limit}&page=${page}`;
	return http.get(url, params, config)
};
export const storeAdd = (params, config = {}) => http.post('admin/Store/add', params, config);
export const storeEdit = (params, config = {}) => http.post('admin/Store/edit', params, config);

export const staffList = (params, config = {}) => {
	const limit = params.limit ? params.limit : 10;
	const page = params.page ? params.page : 1;
	const url = `admin/Staff/index?limit=${limit}&page=${page}`;
	return http.get(url, params, config)
};
export const staffAdd = (params, config = {}) => http.post('admin/Staff/add', params, config);
export const staffEdit = (params, config = {}) => http.post('admin/Staff/edit', params, config);


